package com.aspose.cells;

class zbsv extends zbz {
   zbsv(int var1) {
      this.c(4133);
      this.b = var1;
      this.b(32);
      this.c = new byte[this.d()];
      this.c[0] = 2;
      this.c[1] = 2;
      this.c[2] = 1;
      this.c[8] = -42;
      this.c[9] = -1;
      this.c[10] = -1;
      this.c[11] = -1;
      this.c[12] = -70;
      this.c[13] = -1;
      this.c[14] = -1;
      this.c[15] = -1;
      this.c[24] = -79;
      this.c[26] = 77;
      this.c[28] = 80;
      this.c[29] = 26;
   }

   void a(DataLabels var1) {
      this.c[28] = (byte)(this.c[28] | 128);
      this.c[29] = (byte)(this.c[29] | 58);
      this.b(var1);
      Object var2 = var1.L();
      if (var2 instanceof Trendline) {
         this.c[25] = 64;
      } else {
         if (var2 instanceof Series) {
            this.c[24] = (byte)(this.c[24] | 16);
         }

         this.c[25] = (byte)(this.c[25] & 7);
         if (var1.getShowPercentage()) {
            this.c[25] = (byte)(this.c[25] | 16);
         }

         if (var1.getShowValue()) {
            this.c[24] = (byte)(this.c[24] | 4);
         }

         if (ChartCollection.p(var1.getChart().getType())) {
            if (var1.getShowSeriesName()) {
               this.c[25] = (byte)(this.c[25] | 64);
            }
         } else if (var1.getShowCategoryName()) {
            this.c[25] = (byte)(this.c[25] | 64);
         }

         if (var1.getShowBubbleSize()) {
            this.c[25] = (byte)(this.c[25] | 32);
         }

         if (var1.getShowPercentage() && var1.getShowCategoryName()) {
            this.c[25] = (byte)(this.c[25] | 8);
         }

         if (var1.N()) {
            if (var1.getShowPercentage()) {
               this.c[25] = (byte)(this.c[25] & 19);
               this.c[24] = (byte)(this.c[24] & 251);
            } else if (var1.getShowBubbleSize()) {
               if (var1.getShowValue()) {
                  this.c[25] = (byte)(this.c[25] & 15);
               } else if (var1.getShowCategoryName()) {
                  this.c[25] = (byte)(this.c[25] & 79);
               } else {
                  this.c[25] = (byte)(this.c[25] & 47);
               }
            } else if (var1.getShowValue()) {
               this.c[25] = (byte)(this.c[25] & 15);
            }
         }

         if (var1.getShowLegendKey()) {
            this.c[24] = (byte)(this.c[24] | 2);
         }

         DataLabels var3 = null;
         if (var2 instanceof ChartPoint) {
            var3 = ((ChartPoint)var2).a().getDataLabels();
         }

         if (!var1.r) {
            this.c(var1);
         } else if (var3 != null && !var3.r) {
            this.c(var3);
         }

      }
   }

   private void c(DataLabels var1) {
      switch(var1.getPosition()) {
      case 0:
         this.c[28] = (byte)(this.c[28] | 3);
         break;
      case 1:
         this.c[28] = (byte)(this.c[28] | 4);
         break;
      case 2:
         this.c[28] = (byte)(this.c[28] | 2);
         break;
      case 3:
         this.c[28] = (byte)(this.c[28] | 1);
         break;
      case 4:
         this.c[28] = (byte)(this.c[28] | 5);
         break;
      case 5:
         this.c[28] = (byte)(this.c[28] | 6);
         break;
      case 6:
         this.c[28] = (byte)(this.c[28] | 7);
         break;
      case 7:
         this.c[28] = (byte)(this.c[28] | 8);
         break;
      case 8:
         this.c[28] = (byte)(this.c[28] | 9);
         break;
      case 9:
         this.c[28] = (byte)(this.c[28] | 10);
      }

   }

   void a(Font var1) {
      if (var1 != null && !com.aspose.cells.a.c.zh.a(var1.getColor()) && var1.b() >= 0 && var1.b() != 32767 && var1.b() != 32759) {
         this.c[24] = (byte)(this.c[24] & 254);
         int var2 = (com.aspose.cells.a.c.zh.d(var1.getColor()) & 255) * 65536 + (com.aspose.cells.a.c.zh.c(var1.getColor()) & 255) * 256 + (com.aspose.cells.a.c.zh.b(var1.getColor()) & 255);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.b()), 0, this.c, 26, 2);
      }

   }

   void b(DataLabels var1) {
      this.c[24] = -111;
      switch(var1.getTextHorizontalAlignment()) {
      case 1:
         this.c[0] = 2;
      case 2:
      case 4:
      case 5:
      default:
         break;
      case 3:
         this.c[0] = 7;
         break;
      case 6:
         this.c[0] = 4;
         break;
      case 7:
         this.c[0] = 1;
         break;
      case 8:
         this.c[0] = 3;
      }

      switch(var1.getTextVerticalAlignment()) {
      case 0:
         this.c[1] = 3;
         break;
      case 1:
         this.c[1] = 2;
      case 2:
      case 4:
      case 5:
      case 7:
      case 8:
      default:
         break;
      case 3:
         this.c[1] = 7;
         break;
      case 6:
         this.c[1] = 4;
         break;
      case 9:
         this.c[1] = 1;
      }

      if (var1.z() != null && !"".equals(var1.z())) {
         this.c[24] = (byte)(this.c[24] & 239);
      } else if (var1.isDeleted()) {
         this.c[24] = (byte)(this.c[24] | 64);
      } else if (var1.isAutoText()) {
         this.c[24] = (byte)(this.c[24] | 16);
      }

      this.a((ChartFrame)var1);
      if (var1.A()) {
         this.c[30] = -1;
      } else if (var1.getRotationAngle() >= 0) {
         this.c[30] = (byte)var1.getRotationAngle();
      } else {
         this.c[30] = (byte)(90 - var1.getRotationAngle());
      }

      this.c[28] = 48;
      this.c[29] = 16;
      switch(var1.getTextDirection()) {
      case 0:
      default:
         break;
      case 1:
         this.c[29] = (byte)(this.c[29] | 64);
         break;
      case 2:
         this.c[29] = (byte)(this.c[29] | 128);
      }

   }

   void a(Title var1) throws Exception {
      this.c[24] = -111;
      if (var1.r() != null) {
         zbst var2 = var1.r();
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2.a), 0, this.c, 8, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2.b), 0, this.c, 12, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2.c), 0, this.c, 16, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2.d), 0, this.c, 20, 4);
      } else {
         var1.getChart().a(false, false);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getX()), 0, this.c, 8, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getY()), 0, this.c, 12, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getWidth()), 0, this.c, 16, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getHeight()), 0, this.c, 20, 4);
      }

      switch(var1.getTextHorizontalAlignment()) {
      case 1:
         this.c[0] = 2;
      case 2:
      case 4:
      case 5:
      default:
         break;
      case 3:
         this.c[0] = 7;
         break;
      case 6:
         this.c[0] = 4;
         break;
      case 7:
         this.c[0] = 1;
         break;
      case 8:
         this.c[0] = 3;
      }

      switch(var1.getTextVerticalAlignment()) {
      case 0:
         this.c[1] = 3;
         break;
      case 1:
         this.c[1] = 2;
      case 2:
      case 4:
      case 5:
      case 7:
      case 8:
      default:
         break;
      case 3:
         this.c[1] = 7;
         break;
      case 6:
         this.c[1] = 4;
         break;
      case 9:
         this.c[1] = 1;
      }

      this.a((ChartFrame)var1);
      if (var1.getText() != null && !"".equals(var1.getText())) {
         this.c[24] = (byte)(this.c[24] & 239);
      } else if (var1.E()) {
         this.c[24] = (byte)(this.c[24] | 64);
      } else if (var1.isAutoText()) {
         this.c[24] = (byte)(this.c[24] | 16);
      }

      if (var1.F()) {
         this.c[30] = -1;
      } else if (var1.getRotationAngle() >= 0) {
         this.c[30] = (byte)var1.getRotationAngle();
      } else {
         this.c[30] = (byte)(90 - var1.getRotationAngle());
      }

      this.c[28] = 48;
      if (!var1.i() || !var1.l()) {
         this.c[28] = (byte)(this.c[28] | 10);
      }

      this.c[29] = 16;
      switch(var1.getTextDirection()) {
      case 0:
      default:
         break;
      case 1:
         this.c[29] = (byte)(this.c[29] | 64);
         break;
      case 2:
         this.c[29] = (byte)(this.c[29] | 128);
      }

   }

   void a(Axis var1, DisplayUnitLabel var2) {
      this.c[24] = -111;
      switch(var2.getTextHorizontalAlignment()) {
      case 1:
         this.c[0] = 2;
      case 2:
      case 4:
      case 5:
      default:
         break;
      case 3:
         this.c[0] = 7;
         break;
      case 6:
         this.c[0] = 4;
         break;
      case 7:
         this.c[0] = 1;
         break;
      case 8:
         this.c[0] = 3;
      }

      switch(var2.getTextVerticalAlignment()) {
      case 0:
         this.c[1] = 3;
         break;
      case 1:
         this.c[1] = 2;
      case 2:
      case 4:
      case 5:
      case 7:
      case 8:
      default:
         break;
      case 3:
         this.c[1] = 7;
         break;
      case 6:
         this.c[1] = 4;
         break;
      case 9:
         this.c[1] = 1;
      }

      if (var1.isDisplayUnitLabelShown()) {
         if (var2.getText() != null && !"".equals(var2.getText())) {
            this.c[24] = (byte)(this.c[24] & 239);
         }
      } else {
         this.c[24] = (byte)(this.c[24] | 64);
      }

      this.a((ChartFrame)var2);
      if (var2.A()) {
         this.c[30] = -1;
      } else if (var2.getRotationAngle() >= 0) {
         this.c[30] = (byte)var2.getRotationAngle();
      } else {
         this.c[30] = (byte)(90 - var2.getRotationAngle());
      }

      this.c[28] = 48;
      if (!var2.i() || !var2.l()) {
         this.c[28] = (byte)(this.c[28] | 10);
      }

      this.c[29] = 16;
      switch(var2.getTextDirection()) {
      case 0:
      default:
         break;
      case 1:
         this.c[29] = (byte)(this.c[29] | 64);
         break;
      case 2:
         this.c[29] = (byte)(this.c[29] | 128);
      }

   }

   int[] a(ChartFrame var1) {
      this.a(var1.g());
      this.a(var1.getBackgroundMode());
      int[] var2 = new int[5];
      if (this.c[2] == 1) {
         var2[0] = 525;
      } else {
         var2[0] = 269;
      }

      var2[1] = this.c[30] & 255;
      var2[2] = this.c[0] & 255;
      var2[3] = this.c[1] & 255;
      var2[4] = (byte)((this.c[29] & 255 & 240) >> 4) & 255;
      return var2;
   }

   void a(int var1) {
      switch(var1) {
      case 1:
         this.c[24] = (byte)(this.c[24] & 127);
         this.c[2] = 2;
         break;
      case 2:
         this.c[24] = (byte)(this.c[24] & 127);
      }

   }
}
